Skip to content

fix(cloudflare): calculate retries not attempts #16834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 8, 2025

Conversation

stayallive
Copy link
Contributor

The message.attempts property starts at 1 so we were calculating the number of attempts not the number of retries. Attempt 2 is the first retry not attempt 1.

Currently the retry count is the same as the number of messages in the batch this way:

Screenshot 2025-07-07 at 23 40 48

Additionally this causes the error rate to be quite nice and I have been assured my code is not THAT bad:

Screenshot 2025-07-07 at 23 41 43

See: https://developers.cloudflare.com/queues/configuration/javascript-apis/

The `message.attempts` property starts at 1 so we were calculating the number of attempts not the number of retries. Since attempt 2 is the first retry.
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, thank you!

@mydea
Copy link
Member

mydea commented Jul 8, 2025

There seems to be a linting issue, could you run yarn fix, then this should be good to go - thank you 🙏

@stayallive
Copy link
Contributor Author

Ah, yeah of course. 2.1 GB of node_modules later I think it ran enough to fix the linting 😎

@AbhiPrasad AbhiPrasad merged commit 64904f5 into getsentry:develop Jul 8, 2025
146 checks passed
@stayallive stayallive deleted the cf-worker-retries branch July 8, 2025 15:05
AbhiPrasad added a commit that referenced this pull request Jul 8, 2025
This PR adds the external contributor to the CHANGELOG.md file, so that
they are credited for their contribution. See #16834

Co-authored-by: AbhiPrasad <18689448+AbhiPrasad@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants